package com.alex.boot.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * 事件发布类
 */
@Component
public class PublisherEvent {

    @Autowired
    private ApplicationContext applicationContext;

    public void publish(Object source, String receiver, String content) {
        applicationContext.publishEvent(new SendMsgEvent(source, receiver, content));
    }
}
